package com.jiukuaidao.zhulin.api;

import com.jiukuaidao.library.net.ApiBaseParamAbstract;
import com.jiukuaidao.library.net.MyRetroCallBack;
import com.jiukuaidao.library.net.RootResult;
import com.jiukuaidao.zhulin.util.NetUtil;
import com.jiukuaidao.zhulin.util.RetrofitUtil;

import retrofit2.Call;

/**
 * Author : H_Joker
 * Date : 2016/5/13
 * Description :
 */
public class ApiGetSortProList<T> extends ApiBaseParamAbstract {

    /**
     * @param cityCode
     * @param longitude
     * @param latitude
     * @param categoryIds    分类和属性id的数组, 如 白酒 香型 产地
     * @param pageIndex
     * @param tagId           热门推荐的id
     * @param brandId         热门品牌的id
     * @param keyWord         模糊搜索关键词
     * @param myRetroCallBack
     */
    public ApiGetSortProList(String cityCode, String longitude, String latitude, String categoryIds, int pageIndex, String tagId, String brandId, String keyWord, MyRetroCallBack<T> myRetroCallBack) {
        super(myRetroCallBack);
        mParams.put("pageIndex", pageIndex);
        mParams.put("latitude", latitude);
        mParams.put("longitude", longitude);
        mParams.put("tagId", tagId);
        mParams.put("brandId", brandId);
        mParams.put("categoryIds", categoryIds);
        mParams.put("keyWord", keyWord);
        mParams.put("baiduCityCode", cityCode);
    }

    @Override
    public Call<RootResult> getCall() {
        return RetrofitUtil.getApiManager(mParams, NetUtil.getResHeaderListener()).getSortPros(mParams);
    }
}
